package com.castle.fortress.admin.flowable.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 流程节点类型
 * @author  castle
 */
@Getter
@AllArgsConstructor
public enum FlowableNodeTypeEnum {
    ROOT(1,"ROOT","开始节点"),
    SP(2,"SP","审批节点"),
    CS(3,"CS","抄送节点"),
    TJ(4,"TJ","条件节点"),
    CONDITION(5,"CONDITION","条件"),
    EMPTY(6,"EMPTY","空"),//分支节点的汇总节点
    ;

    Integer code;
    String name;
    String desc;

    public static String getNameByCode(Integer code){
        for(FlowableNodeTypeEnum e: FlowableNodeTypeEnum.values()){
            if(e.getCode().equals(code)){
                return e.getName();
            }
        }
        return null;
    }
}
